import { pubRequire } from '@utils/public'
const baseUrl = '/robots'
/* 马甲管理获取列表 */
export function getSearchList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callbBack, errBack)
}
/* 绑定马甲获取列表 */
export function getBindVest(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callbBack, errBack)
}
/* 添加马甲提交表单*/
export function addSubForm(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callbBack, errBack)
}
/* 解绑单个按钮 */
export function removeBindAPI(id, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}/unbinding`, '', callbBack, errBack)
}
/* 批量解绑单个按钮 */
export function removeBindSomeAPI(obj, callbBack, errBack) {
  return pubRequire('delete', `${baseUrl}/unbinding`, obj, callbBack, errBack)
}
/* 解绑全部马甲按钮 */
export function untieAllVestsAPI(operateId, callbBack, errBack) {
  return pubRequire(
    'delete',
    `${baseUrl}/users/${operateId}/unbinding`,
    '',
    callbBack,
    errBack
  )
}
//导入接口
export function importUrl() {
  return `${baseUrl}/import`
}

//下载模板接口
export function downUrl() {
  return `${baseUrl}/download`
}
// 批量修改
export function importEdit() {
  return `${baseUrl}/import-update`
}
//批量下载模板接口
export function batchDownUrl() {
  return `${baseUrl}/download-by-update`
}

/*绑定马甲表单提交*/
export function bindSubmit(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}/binding`, obj, callbBack, errBack)
}
/*添加/编辑备注*/
export function addNoteAPI(id, obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}/remarks`, obj, callbBack, errBack)
}
/* 获取马甲详情 */
export function getVestDetail(id, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/${id}`, '', callbBack, errBack)
}
// 编辑马甲等级
export function editGradeAPI(robotId, obj, callbBack, errBack) {
  return pubRequire(
    'put',
    `${baseUrl}/${robotId}/grade`,
    obj,
    callbBack,
    errBack
  )
}
// 编辑马甲等级
export function robotStatusAPI(robotId, obj, callbBack, errBack) {
  return pubRequire(
    'put',
    `${baseUrl}/${robotId}/statu`,
    obj,
    callbBack,
    errBack
  )
}
